﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.Practices.CompositeUI;

namespace WinFormCD.Infrastructure.Interface.Services
{
    class UserCondition : IActionCondition
    {
        #region IActionCondition Members

        bool IActionCondition.CanExecute(string action, Microsoft.Practices.CompositeUI.WorkItem context, object caller, object target)
        {
            if (action == "ShowMyView" && Thread.CurrentPrincipal.Identity.Name == "officer")
                return true;
            else
                return false;
        }

        #endregion
    }
}
